package com.jay.base.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by caoyuan7 on 2019/4/26.
 */
public class CalendarTest {
    public static void main(String args[]) throws ParseException {
//        Calendar cal = Calendar.getInstance();
//        int maxDay=cal.getActualMaximum(Calendar.DAY_OF_MONTH);
//        java.text.Format formatter3=new java.text.SimpleDateFormat("yyyy-MM-"+maxDay);
//        System.out.println(formatter3.format(cal.getTime()));

//        java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd");
//        java.util.Date beginDate= format.parse("2007-12-24");
//        java.util.Date endDate= format.parse("2007-12-25");
//        long day=(endDate.getTime()-beginDate.getTime())/(24*60*60*1000);
//        System.out.println("相隔的天数="+day);
        SimpleDateFormat simp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date();
        java.util.Calendar cal=java.util.Calendar.getInstance();
        cal.setTime(date);
        cal.add(Calendar.DAY_OF_WEEK,1);
        System.out.println("日期:"+simp.format(cal.getTime()));
    }
}
